<?php
class AjaxProcessor extends CFormModel{
    protected $_response;
    
    public function setRequest($request){
        $this->attributes = $request;
        return $this;
    }    
    
    public function setResponse($key,$value){
        $this->_response[$key] = $value;
        return $this;
    }
    
    public function serialize($response){
        return json_encode($response);
    }
    
    public function response(){
        return $this->serialize($this->_response);
    }
}